﻿@{
    ViewBag.Title = "统计表";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}

<script>
    var moduleId = $.request("moduleId");
    $(function () {
        initControl();
        gridList1();
        })
        function initControl() {
            $('select').bindSelect();
            $("#ZSJ_B1_GH_SI").bindSelect({
                url: "/BaseData/ZSJ_B1_GH_SI/GetGridJson",
                id: "UnitID",
                text: "UnitNOShortName"
            });
            //零件分类
            $("#FProductionTypeName").bindSelect({//FClassNO ='01'
                url: "/VBaseData/V_BUS_SJ_Dictionary/GetSJ_DictionaryEntity",
                id: "UseUnit",
                text: "FTypeName",
            });
            //供货单位名称
            $("#FProCompanyNO").bindSelect({
                url: "/BaseData/ZSJ_B1_GH_SI/GetGridJson?isProduct=1",
                id: "UnitNO",
                text: "UnitNOShortName"
            });
        }
        function gridList1() {
            $("#grid1").show();
            $("#grid2").hide();
            var $gridList = $("#gridList1");
            $gridList.dataGridForJson({
                url: "/VBaseData/V_CPK_44_MX_StoCPKListAcco_Mid_MX/GetGridJson",
                        height: $(window).height() - 150,
                        colModel: [
                        //{ label: '序号', name: 'FBatchNo', width: 100, align: 'left' },
                        { label: '生产单位', name: 'FProCompanyNO', width: 80, align: 'left' },
                        { label: '零件编号', name: 'UnitShortName', width: 160, align: 'left' },
                        { label: "零件名称", name: "FProductionNO", width: 160, align: 'left' },
                        { label: '前期数量', name: 'FProductionName', width: 100, align: 'right' },


                        { label: '前期金额', name: 'FQuantity', width: 100, align: 'right' },
                        { label: '本月数量', name: 'FContainerNO', width: 100, align: 'right' },
                        { label: '本月金额', name: 'FContainerName', width: 100, align: 'right' },


                        { label: '累计数量', name: 'FContainerQuantity', width: 100, align: 'right' },
                        { label: '累计金额', name: 'FFactContent', width: 100, align: 'right' },
                        { label: '供货单位', name: 'FContent', width: 120, align: 'right' },
                        { label: '零件类型', name: 'FPalletNO', width: 100, align: 'left' },
                        ],
                        pager: "#gridPager1",
                        sortname: 'FProCompanyNO asc',
                        viewrecords: true,
                        onSelectRow: function (rowId) {
                            rowData = $gridList.jqGrid('getRowData', rowId);
                            index = rowId;
                            $.each(rowData, function (key, value) {
                                $("#txt" + key).val(value);
                            });
                        }
                    });
                    $("#btn_search").click(function () {
                        $gridList.jqGrid('setGridParam', {
                            postData: { keyword: $("#txt_FDocuTypeNO").val() },
                        }).trigger('reloadGrid');
                    });
        }

    function btn_Excel() {
        $.detailOpen({
            id: "Detail",
            title: "",
            url: "/WareHouse/Export/WareHouseNoticeExcel"
        });
    }
    function btn_Print() {
        $.detailOpen({
            id: "Detail",
            title: "",
            url: "/WareHouse/Print/WareHouseNoticePrint"
        });
    }
</script>
<body>
    <div id="layout" style="height: 100%; width: 100%;">
        <form id="form1">
            <div style="padding: 12px 0 5px 0; padding-left:15px; border-bottom:1px solid #ccc;" class="line-table input-width-140">

               <div class="btn-group" style="margin-top:12px;margin-left:10px;">
                    &nbsp;
                    <a id="" class="btn btn-primary center-block" onclick="btn_Search()"><span class="glyphicon glyphicon-search"></span>  &nbsp; 查询</a>
                </div>
            </div>
        </form>
        <div id="grid1">
            <table id="gridList1"></table>
            <div id="gridPager1"></div>
        </div>
        <div id="grid2">
            <table id="gridList2"></table>
            <div id="gridPager2"></div>
        </div>
    </div>
</body>